#import "YHRefreshGiftHeader.h"
#import "YHRefreshUtils.h"


@implementation YHRefreshGiftHeader
- (void)prepare {
    [super prepare];
    self.lastUpdatedTimeLabel.hidden = YES;
    self.stateLabel.hidden = YES;
    NSMutableArray *pullingImages = [NSMutableArray new];
    UIImage *image = [YHRefreshUtils getImageFromBundle:@"ic_pull_refresh_normal"];
    [pullingImages addObject:image];
    UIImage *image2 = [YHRefreshUtils getImageFromBundle:@"ic_pull_refresh_ready"];
    [pullingImages addObject:image2];
    NSArray *arrimg = [NSArray arrayWithObject:[pullingImages firstObject]];
    [self setImages:arrimg forState:MJRefreshStateIdle];
    NSArray *arrimg2 = [NSArray arrayWithObject:[pullingImages lastObject]];
    [self setImages:arrimg2 forState:MJRefreshStatePulling];
    NSMutableArray *refreshingImages = [NSMutableArray array];
    for (NSUInteger i = 0; i <= 8; i++) {
        UIImage *image = [YHRefreshUtils getImageFromBundle:[NSString stringWithFormat:@"ic_pull_refresh_%lu", (unsigned long)i]];
        if (image) {
            [refreshingImages addObject:image];
        }
    }
    [self setImages:refreshingImages forState:MJRefreshStateRefreshing];
}
- (void)placeSubviews {
    [super placeSubviews];
    self.gifView.transform = CGAffineTransformMakeScale(0.75, 0.75);
}
@end
